package com.patttern.behavior.strategy;

/**
 * @Author: root
 * @Date: 2018/12/3 22:37
 */
public class Context {
    private Strategy strategy;

    public Context() {
    }

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    public Strategy getStrategy() {
        return strategy;
    }

    public void setStrategy(Strategy strategy) {
        this.strategy = strategy;
    }

    public void printPrice(double standrdPrice) {
        System.out.println("原来的价格：" + standrdPrice);
        System.out.println("打折后的价格：" + strategy.getPrice(standrdPrice));
    }
}
